package com.carkeeper.tweet.listener;

import com.carkeeper.tweet.config.RabbitMQConfig;
import com.carkeeper.tweet.service.TweetService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @program: carkeeper_parent
 * @Date: 2020/11/25 10:54
 * @Author: qgg
 * @Description:
 */
@Component
public class TweetUpListener {

    @Autowired
    public TweetService tweetService;

    @RabbitListener(queues = RabbitMQConfig.SEARCH_ADD_QUEUE)
    public void getMessage(String message){
        System.out.println("接收到消息：" + message);

        //查询
        tweetService.importDataToESById(message);
    }
}
